package com.jk.vehicle.mini.constant;

/**
 * 常用是否枚举
 */
public enum ReviewStatusEnum {
    /**
     * 待审核
     */
    WAIT_REVIEW((byte)0, "待审核"),

    /**
     * 审核通过
     */
    PASS((byte)1, "审核通过"),

    /**
     * 审核拒绝
     */
    REFUSE((byte)2, "审核拒绝");

    private Byte code;

    private String name;

    private ReviewStatusEnum(Byte code, String name) {
        this.code = code;
        this.name = name;
    }

    public Byte getCode() {
        return code;
    }

    public void setCode(Byte code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据CODE获取枚举实例
     * @param code 枚举编号
     * @return 枚举实例
     */
    public static ReviewStatusEnum getEnum(Byte code){
        for(ReviewStatusEnum animal: ReviewStatusEnum.values()){
            if(animal.code.equals(code)){
                return animal;
            }
        }
        return null;
    }
}
